// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login/Login';
// 首页
import Home from '@/views/home/Home';
/**
 * 我的用户
 */
// 我的用户——查询用户
import QueryClient from '@/views/admin/client/QueryClient';
// 我的用户——批量分配
import AllocationClient from '@/views/admin/client/AllocationClient';
// 我的用户——批量认领
import ClaimClient from '@/views/admin/client/ClaimClient';
// 我的用户——创建潜在用户
import CreateClient from '@/views/admin/client/CreateClient';
// 我的用户——退出申请
import ExitApplication from '@/views/admin/client/ExitApplication';
// 我的用户——联系地址查询
import QueryClientAddress from '@/views/admin/client/QueryClientAddress';
/**
 * 我的任务
 */
// 我的任务——任务列表
import TanskList from '@/views/admin/tansk/TanskList';

/**
 * 我的日志
 */
// 我的日志——日志列表
import LogList from'@/views/admin/myLog/LogList';


/**
 * 营销管理
 */
// 营销管理——客户经理管理团队
import AccountManagerTeam from '@/views/admin/marketingManagement/AccountManagerTeam';
// 营销管理——公告管理
import Announcement from '@/views/admin/marketingManagement/Announcement';
// 营销管理——客户群管理
import clientBase from '@/views/admin/marketingManagement/clientBase';
// 营销管理——事件任务触发设置
import EventTrigger from '@/views/admin/marketingManagement/EventTrigger';
// 营销管理——短消息设置
import message from '@/views/admin/marketingManagement/message';
// 营销管理——产品管理
import product from '@/views/admin/marketingManagement/product';
// 营销管理——任务类型反馈设置
import TaskFeedbackType from '@/views/admin/marketingManagement/TaskFeedbackType';

/**
 * 区域营销
 */
// 区域营销——区域管理
import DistrictManagement from '@/views/admin/regionalMarketing/DistrictManagement';
// 区域营销——区域客户管理
import RegionalAccountManagement from '@/views/admin/regionalMarketing/RegionalAccountManagement';
// 区域营销——区域经理管理
import RegionalManagerManagement from '@/views/admin/regionalMarketing/RegionalManagerManagement';

/**
 * 我的绩效
 */
// 我的绩效——中间业务认领
import IntermediateBusiness from '@/views/admin/performance/IntermediateBusiness';
// 我的绩效——我的绩效
import MyPerformance from '@/views/admin/performance/MyPerformance';
// 我的绩效——模拟利润计算器
import ProfitCalculator from '@/views/admin/performance/ProfitCalculator';
// 我的绩效——绩效参数维护
import ThePerformanceParameters from '@/views/admin/performance/ThePerformanceParameters';


/**
 * 绩效管理
 */
// 绩效管理——考核方案管理
import AssessmentSchemeManagement from '@/views/admin/performanceManagement/AssessmentSchemeManagement';
// 绩效管理——考核结果管理
import EvaluationResult from '@/views/admin/performanceManagement/EvaluationResult';
// 绩效管理——指标体系管理
import IndexSystemManagement from '@/views/admin/performanceManagement/IndexSystemManagement';
// 绩效管理——考核数据维护
import InspectionData from '@/views/admin/performanceManagement/InspectionData';
// 绩效管理——业绩回算需求
import PerformanceReport from '@/views/admin/performanceManagement/PerformanceReport';
// 绩效管理——任务管理
import TaskManagement from '@/views/admin/performanceManagement/TaskManagement';

/**
 * 统计分析
 */
// 统计分析——客户分析
import ClientAnalyse from '@/views/admin/statistic/ClientAnalyse';
// 统计分析——客户经理分析
import CustomerManagerAnalyse from '@/views/admin/statistic/CustomerManagerAnalyse';
// 统计分析——机构分析
import MechanismAnalyse from '@/views/admin/statistic/MechanismAnalyse';
// 统计分析——绩效分析
import PerformanceAnalysis from '@/views/admin/statistic/PerformanceAnalysis';
// 统计分析——区域客户分析
import RegionalClientAnalyse from '@/views/admin/statistic/RegionalClientAnalyse';

/**
 * 系统管理
 */
// 系统管理——授权管理
import AuthorizationManagement  from '@/views/admin/system/AuthorizationManagement ';
// 系统管理——菜单管理
import MenuManagement from '@/views/admin/system/MenuManagement';
// 系统管理——机构管理
import OrganizationManagement from '@/views/admin/system/OrganizationManagement';
// 系统管理——人员维护
import PersonnelMaintain from '@/views/admin/system/PersonnelMaintain';
// 系统管理——角色管理
import RoleManagement from '@/views/admin/system/RoleManagement';

// 系统管理——用户登录日志
import UserLoginLog from '@/views/admin/system/UserLoginLog';



/**
 * 错误页面
 */
import Error401 from '@/views/error/error-page/401.vue';
import Error404 from '@/views/error/error-page/404.vue';



import Test from '@/views/test'

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

// 启用路由
Vue.use(Router);

// 导出路由
export default new Router({
  routes: [{
    path: '/',
    name: '',
    component: login,
    hidden: true,
    meta: {
      requireAuth: false
    }
  }, {
    path: '/login',
    name: '登录',
    component: login,
    hidden: true,
    meta: {
      requireAuth: false
    }
  }, {
    path: '/index',
    name: '首页',
    component: Home,
    iconCls: 'el-icon-tickets',
    children: [
      {
        path: '/exam/test',
        name: '测试路由',
        component: Test ,
        hidden: true,
        meta: {
          requireAuth: true
        }
      },
      {
        path:"/client/AllocationClient",
        name:'批量分配',
        component:AllocationClient,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/client/ClaimClient',
        name: '批量认领',
        component: ClaimClient,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/client/CreateClient',
        name: '创建潜在客户',
        component: CreateClient,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/client/ExitApplication',
        name: '退出申请',
        component: ExitApplication,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/client/QueryClient',
        name: '查询用户',
        component: QueryClient,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/client/QueryClientAddress',
        name: '联系地址查询',
        component: QueryClientAddress,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/tansk/TanskList',
        name: '任务列表',
        component: TanskList,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/myLog/LogList',
        name: '日志列表',
        component: LogList,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/marketingManagement/AccountManagerTeam',
        name: '客户经理团队管理',
        component: AccountManagerTeam,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/marketingManagement/Announcement',
        name: '公告管理',
        component: Announcement,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/marketingManagement/clientBase',
        name: '客户群管理',
        component: clientBase,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/marketingManagement/EventTrigger',
        name: '事件任务触发设置',
        component: EventTrigger,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/marketingManagement/message',
        name: '短消息管理',
        component: message,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/marketingManagement/product',
        name: '产品管理',
        component: product,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/marketingManagement/TaskFeedbackType',
        name: '任务反馈类型设置',
        component: TaskFeedbackType,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/regionalMarketing/DistrictManagement',
        name: '区域管理',
        component: DistrictManagement,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/regionalMarketing/RegionalAccountManagement',
        name: '区域客户管理',
        component: RegionalAccountManagement,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/regionalMarketing/RegionalManagerManagement',
        name: '区域经理管理',
        component: RegionalManagerManagement,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/performance/IntermediateBusiness',
        name: '中间业务认领',
        component: IntermediateBusiness,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/performance/MyPerformance',
        name: '我的绩效',
        component: MyPerformance,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/performance/ProfitCalculator',
        name: '模拟利润计算器',
        component: ProfitCalculator,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/performance/ThePerformanceParameters',
        name: '绩效参数维护',
        component: ThePerformanceParameters,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/performanceManagement/AssessmentSchemeManagement',
        name: '考核方案管理',
        component: AssessmentSchemeManagement,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/performanceManagement/EvaluationResult',
        name: '考核结果管理',
        component: EvaluationResult,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/performanceManagement/IndexSystemManagement',
        name: '指标体系管理',
        component: IndexSystemManagement,
        hidden: true,
        meta: {
          requireAuth: false
        }
      },
      {
        path: '/performanceManagement/InspectionData',
        name: '考核数据维护',
        component: InspectionData,
        hidden: true,
        meta: {
          requireAuth: false
        }
      },
      {
        path: '/performanceManagement/PerformanceReport',
        name: '业绩回算需求',
        component: PerformanceReport,
        hidden: true,
        meta: {
          requireAuth: false
        }
      },
      {
        path: '/performanceManagement/TaskManagement',
        name: '任务管理',
        component: TaskManagement,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/statistic/ClientAnalyse',
        name: '客户分析',
        component: ClientAnalyse,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/statistic/CustomerManagerAnalyse',
        name: '客户经理分析',
        component: CustomerManagerAnalyse,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/statistic/RegionalClientAnalyse',
        name: '区域客户分析',
        component: RegionalClientAnalyse,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/statistic/MechanismAnalyse',
        name: '机构分析',
        component: MechanismAnalyse,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/statistic/PerformanceAnalysis',
        name: '绩效分析',
        component: PerformanceAnalysis,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/system/AuthorizationManagement ',
        name: '授权管理',
        component: AuthorizationManagement ,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/system/MenuManagement',
        name: '菜单管理',
        component: MenuManagement,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/system/PersonnelMaintain',
        name: '人员维护',
        component: PersonnelMaintain,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/system/RoleManagement',
        name: '角色管理',
        component: RoleManagement,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/system/UserLoginLog',
        name: '用户登录日志',
        component: UserLoginLog,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
      {
        path: '/system/OrganizationManagement',
        name: '机构管理',
        component: OrganizationManagement,
        hidden: true,
        meta: {

          requireAuth: true
        }
      },
    ]
  },{
    path:"/error/401",
    name:"Page401",
    component:Error401,
    hidden:true,
    meta:{
      requireAuth:false
    }
  },{
    path:"/error/404",
    name:"Page404",
    component:Error404,
    hidden:true,
    meta:{
      requireAuth:false
    }
  }
]
})
